<?php
class CategoryList extends CWidget
{
	public $htmlOptions = array(
		'id'=>'category',
		'class'=>'category'
	);
	
	public $view = 'list';
	
	public $type;
	
	public $data;
	
	public $model;
	
	public function getCategories()
	{
		$models = Category::model()->getCategoryModelByType($this->type);
		
		$this->data = Category::model()->getChildrenObject($models);		
	
		
	}
	
	public function run()
	{
		$this->getCategories();
		
		$this->render($this->view,array(
			'model'=>$this->model
		));
	}
}
?>